package com.anXin.user.controller;


import com.anXin.model.common.dtos.ResponseResult;
import com.anXin.model.user.pojos.Addr;
import com.anXin.user.service.AddrService;
import com.anXin.user.service.UserFanService;
import com.anXin.user.service.UserFollowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "用户关注接口" )
@RestController
@RequestMapping("/userFollow")
public class UserFollowController {

   @Resource
    private UserFanService userFanService;

   @Resource
    private UserFollowService userFollowService;

    @ApiOperation("对方是否是你的粉丝")
   @GetMapping("/isFan/{id}")
    private ResponseResult isFan(@PathVariable("id") Long userId){
       return userFanService.isFan(userId);
   }

    @ApiOperation("对方是否是你的关注")
    @GetMapping("/isFollow/{id}")
    private ResponseResult isFollow(@PathVariable("id") Long userId){
        return userFollowService.isFollow(userId);
    }

    @ApiOperation("粉丝列表")
    @GetMapping("/fanList/{id}")
    private ResponseResult fanList(@PathVariable("id") Long userId){
        return userFanService.fanList(userId);
    }

    @ApiOperation("关注列表")
    @GetMapping("/followList/{id}")
    private ResponseResult followList(@PathVariable("id") Long userId){
        return userFollowService.followList(userId);
    }

    @ApiOperation("关注或取关")
    @GetMapping("/follow/{id}")
    private ResponseResult follow(@PathVariable("id") Long userId){
        return userFollowService.follow(userId);
    }
}